﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.InteropServices;

namespace totto.fingerprint.web
{
    public class fpMethodsDll
    {
        // Use interop to call the method necessary 
        // to clean up the unmanaged resource.
        [System.Runtime.InteropServices.DllImport("Kernel32")]
        private extern static Boolean CloseHandle(IntPtr handle);

        public static bool mTerminateObject(object paObject)
        {
            bool vvRes = false;

            try
            {
                GCHandle gc1 = GCHandle.Alloc(paObject);

                vvRes = CloseHandle(GCHandle.ToIntPtr(gc1));
            }
            catch
            {
                vvRes = false;
            }

            return vvRes;
        }
    }
}